package com.ty.day5;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * Author : txy
 * Create 2023/11/1 10:40
 */
public class Two {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        long x = sc.nextLong(), t = x, y = 0, s = 1, b = 4, e = 7;
        while (true) {
            if (s >= b) {
                y = y * 10 + (t % 10);
            }
            t = t / 10;
            s = s + 1;
            if (s == e + 1 || t == 0) {
                break;
            }
        }
        if (s == e + 1) {
            System.out.println(y);
        } else {
            System.out.println("输入的数据不足7位或者有误！");
        }

    }
}
